<?php

 ?>
<div class="left">
    	<div id="tktt">
			<div id="tieude"><img src="images/timkiemtt.jpg" /></div>
        	<div id="frmtk">
          		<form id="frmlogin" name="formlogin" method="post" action="timkiem.php" onsubmit = 'return validformtk();' >
              		<input type="text" name="txttimkiem" id="txttimkiem" class="frmtimkiem" value="Từ khóa tìm kiếm" onblur="if(this.value=='') this.value='Từ khóa tìm kiếm';" onfocus="if(this.value=='Từ khóa tìm kiếm') this.value='';"/>
              		<div id="frmdanhmuc">
                    <select  id="chondm" name="chondm">
                        <option value=""> Chọn loại sản phẩm</option>
                        <?php echo  getchungloai(0); ?>
                    </select>    
                    </div>
              		<div id="frmsubmit">
              			<input type="submit" name="timkiem" class="save" value="Tìm kiếm" />
              		</div>
         	 </form>
        </div>
       </div>
    <div id="menu">
  		<div id="tieude"><img src="images/dmsp.jpg" /></div>
        <div class="khungmenuleft">
            <?php
        
            function categories ($parentid, &$html = '') {
                $sl = "SELECT * FROM danhmuc WHERE  parent_id = ".intval($parentid)." AND hien_thi = 1";              
                $sql = mysql_query($sl) or die ("không kết nối được bảng danh mục".mysql_error());
                $total = mysql_num_rows($sql);
            
                if($total > 0) {
                        $i = 0;
                        $html .= "<ul class ='topnav'>";
                        while($row = mysql_fetch_assoc($sql)) {
                            
                        if($row['parent_id'] == 0 ){
                            $html .= "<li><a href= '#'> ". $row['tendm'] ." </a>";
                        }else{
                            $html .= "<li><a href= 'sanpham.php?categories=".$row['id']."'> ". $row['tendm'] ." </a>";
                        }
                        categories($row['id'], $html);
                 
                        
                        $html .= '</li>';
                        
                        $i++;
                    }
                        $html .= '</ul>';
                }
                return $html;
            }
            
            echo categories('0');
            ?>
            
        </div>

    </div>
    <div id="httt">
  		<div id="tieude"><img src="images/httt.jpg" /></div>
        <div id="khunghinh">
            <?php
                $query = "SELECT * FROM hotrott";
                $resul = mysql_query($query);
                while($row = mysql_fetch_array($resul)){
                    echo "<span class='hotro_icon'>";
                    echo "<a href= 'ymsgr:sendIM?".$row['nick_ht']."'>";
                    echo "<img src='images/logoquangcao/online.gif' title='".$row['linhvuc_ht']."' />";
                    echo "</a>";
                    echo " </span>";
                    echo "<span class='hotrott' align='center'>" .$row['linhvuc_ht']."</span>";
                }
            ?>

                 
      </div>
   </div>
   <div class="lich">
    <div id="tieude"><img src="images/lichvannien.jpg" /></div>
    <div class ="lichvannien" align="center">
        <script language="JavaScript">
        setOutputSize("small");
        document.writeln(printSelectedMonth());
        </script>
    </div>
    
   </div>
        
</div>